(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/gift/index/index" ], {
    1448: function(t, i, n) {
        var o = n("8564");
        n.n(o).a;
    },
    "2c22": function(t, i, n) {
        n.r(i);
        var o = n("7bed"), e = n("6bbc");
        for (var s in e) "default" !== s && function(t) {
            n.d(i, t, function() {
                return e[t];
            });
        }(s);
        n("1448");
        var c = n("f0c5"), a = Object(c.a)(e.default, o.b, o.c, !1, null, "748a1ab9", null, !1, o.a, void 0);
        i.default = a.exports;
    },
    "6bbc": function(t, i, n) {
        n.r(i);
        var o = n("af7f"), e = n.n(o);
        for (var s in o) "default" !== s && function(t) {
            n.d(i, t, function() {
                return o[t];
            });
        }(s);
        i.default = e.a;
    },
    "7bed": function(t, i, n) {
        n.d(i, "b", function() {
            return e;
        }), n.d(i, "c", function() {
            return s;
        }), n.d(i, "a", function() {
            return o;
        });
        var o = {
            wybPopup: function() {
                return n.e("components/wyb-popup/wyb-popup").then(n.bind(null, "1306"));
            }
        }, e = function() {
            this.$createElement, this._self._c;
        }, s = [];
    },
    8564: function(t, i, n) {},
    af7f: function(t, i, n) {
        (function(t) {
            Object.defineProperty(i, "__esModule", {
                value: !0
            }), i.default = void 0;
            var o = {
                mixins: [ n("ebe2").checkLogin ],
                components: {
                    empty: function() {
                        n.e("components/empty/empty").then(function() {
                            return resolve(n("6234"));
                        }.bind(null, n)).catch(n.oe);
                    },
                    comp_list_one: function() {
                        n.e("components/gift/comp_list_one").then(function() {
                            return resolve(n("7f1c"));
                        }.bind(null, n)).catch(n.oe);
                    },
                    comp_list_double: function() {
                        n.e("components/gift/comp_list_double").then(function() {
                            return resolve(n("e30e"));
                        }.bind(null, n)).catch(n.oe);
                    }
                },
                data: function() {
                    return {
                        couponList: [],
                        site:{},
                        hasLogin: !1,
                        vip: !1,
                        m: 1,
                        max_day: -1,
                        suprise_day: 4,
                        points: 0,
                        pointsList: [ {
                            is_check: !1,
                            show_tip: !1,
                            day: 1
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 2
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 3
                        }, {
                            is_check: !1,
                            show_tip: !0,
                            day: 4
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 5
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 6
                        }, {
                            is_check: !1,
                            show_tip: !0,
                            day: 7
                        } ]
                    };
                },
                onLoad: function() {
                    this.m = this.$db.get("wxapp").model;
                    this.site = this.$db.get("site");
                },
                onShow: function() {
                    this.getdata();
                },
                onPullDownRefresh: function() {
                    this.getdata();
                },
                methods: {
                    hidepopup: function() {
                        this.$refs.popup.hide();
                    },
                    getdata: function() {
                        this.hasLogin = !!this.$db.get("userToken"), this.hasLogin ? (this.getUserInfoFunc(), 
                        this.getUserCheckinFunc()) : this.clear(), this.loadRes();
                    },
                    clear: function() {
                        this.pointsList = [ {
                            is_check: !1,
                            show_tip: !1,
                            day: 1
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 2
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 3
                        }, {
                            is_check: !1,
                            show_tip: !0,
                            day: 4
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 5
                        }, {
                            is_check: !1,
                            show_tip: !1,
                            day: 6
                        }, {
                            is_check: !1,
                            show_tip: !0,
                            day: 7
                        } ], this.max_day = -1, this.suprise_day = 4, this.points = 0;
                    },
                    getUserInfoFunc: function() {
                        var t = this;
                        this.$api.getUserInfoApi({
                            user_id: this.$db.get("userId")
                        }, function(i) {
                            if ("1" == i.code) {
                                var n = i.data;
                                t.$db.set("userInfo", n), t.points = n.points, t.vip = 2 === n.grade;
                            } else t.$common.errorToShow(i.msg);
                        });
                    },
                    getUserCheckinFunc: function() {
                        var t = this;
                        this.$api.getUserCheckin({}, function(i) {
                            if ("1" == i.code) {
                                t.max_day = 0, i.data && (t.max_day = i.data), t.suprisedayFunc(t.max_day);
                                for (var n = 0; n < t.pointsList.length; n++) t.pointsList[n].day <= t.max_day && (t.pointsList[n].is_check = !0), 
                                "" == i.data && (t.pointsList[n].is_check = !1);
                            } else t.$common.errorToShow(i.msg);
                        });
                    },
                    suprisedayFunc: function(t) {
                        t < 4 ? this.suprise_day = 4 - t : t < 7 && (this.suprise_day = 7 - t);
                    },
                    useCheckinFunc: function(t) {
                        var i = this;
                        console.log("item", t), this.hasLogin ? -1 == this.max_day || t.is_check || t.day != Number(this.max_day) + 1 || this.$api.useCheckin({
                            num: t.day
                        }, function(n) {
                            if ("1" == n.code) {
                                4 != t.day && 7 != t.day || i.$refs.popup.show(), i.getUserInfoFunc(), i.$common.errorToShow(n.msg);
                                for (var o = 0; o < i.pointsList.length; o++) i.pointsList[o].day == t.day && (i.pointsList[o].is_check = !0, 
                                i.suprisedayFunc(t.day));
                            } else i.$common.errorToShow(n.msg);
                        }) : this.checkIsLogin();
                    },
                    to_inte: function() {
                        this.hasLogin ? t.navigateTo({
                            url: "/subpages/pages/integral/integral"
                        }) : this.checkIsLogin();
                    },
                    skipVip: function() {
                        this.hasLogin ? this.$common.navigateTo("/pages/member/vip/vip") : this.checkIsLogin();
                    },
                    loadRes: function() {
                        var i = this;
                        this.couponList = [], this.$api.couponListApi({}, function(n) {
                            "1" == n.code ? n.data && n.data.list && (i.couponList = n.data.list, t.stopPullDownRefresh()) : i.$common.errorToShow(n.msg);
                        });
                    }
                }
            };
            i.default = o;
        }).call(this, n("543d").default);
    },
    f8f4: function(t, i, n) {
        (function(t) {
            n("98af"), o(n("66fd"));
            var i = o(n("2c22"));
            function o(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = n, t(i.default);
        }).call(this, n("543d").createPage);
    }
}, [ [ "f8f4", "common/runtime", "common/vendor" ] ] ]);